
# kernel/klib/ Makefile

CC=gcc
INCLUDE=-I../../include

ifeq ($(strip $(C_FLAGS)),)
  C_FLAGS=-march=athlon-fx -m64 -c -ffreestanding 
endif

ifeq ($(ARCH),i386)
  LD_FLAGS=-Tlink.ld -b elf32-i386 --oformat=elf32-i386
endif
ifeq ($(ARCH),x86-64)
  LD_FLAGS=
endif

KLIB_OBJS=string.o

klib.o: $(KLIB_OBJS)
	ld $(LD_FLAGS) -o klib.o $(KLIB_OBJS)
	cp klib.o ..

.c.o:
	$(CC) $(C_FLAGS) $(INCLUDE) $<

clean:
	rm -f klib.o
	rm -f *.o
	rm -f *~
